<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>



    <div id="app" class="page">

        <input v-model="keyword" type="text">
        {{keyword}}


        <button @onclick="searchKey()"  id="searchbtn">搜索</button>

        <p>{{searchKey}}</p>

    </div>




</head>
<body>


<!--前端使用vue 实现前后端分离-->
<script th:src="@{/js/axios.min.js}"></script>
<script th:src="@{/js/vue.min.js}"></script>
<script>
    new Vue({
        el:'#app',
        data:{
            keyword:'java',  //搜索关键字
            results:[]   // 搜索的结果
        },
        methods:{
            searchKey:function (){
                console.log('===',keyword);
                axios.get('search/java/1/1')
                    .then( response=> {
                        console.log(response);
                    });
            }
        }
    })


</script>

</body>
</html>